Topic Index

GALAXY HELP

Index (this topic)

Description

Overview of Operation

Setting Parameters

Saving and Recalling Parameters

Menu Items

Parameter Names

Application Notes

Use as Screen Saver

Galaxy is a shareware program.  The purchase price is whatever you believe to be fair for your intended usage.  I suggest $10 for occaisional use on a single computer.   You may freely redistribute the software, as long as this notification is included.  Source code is available by separate agreement.

You may register and pay $10 via Compuserve: GO SWREG.  Use registration ID 881.

You may also send payment to the author at the following address:
Michael Cornelison
1806 Milmont Drive #185
Milpitas, CA  95035

If you have problems, questions, or suggestions, you may write me at the above address, use Compuserve Mail (76450, 2336), or FAX (408) 942-9180


Program Description

Galaxy is a computer program which simulates the motions of stars under the influence of gravity.  You may create a field of stars to begin with, and then watch how the stars move as they are accelerated by their mutual gravitational attractions.  You may vary the number of stars, their initial velocities around a central position, and the magnitude of the Gravity Constant, which determines the attractive force between every pair of stars.  You may witness how the attractive forces accelerate individual stars and send them careening off into new directions.  You may also witness how large groups of stars develop into interesting patterns of distribution over time.  You can see in a few minutes what would require millions of years for real stars.


Overview of Operation

When the program is started, you will see the following window and menu:

Select the Setup menu and use the Setup Dialog Box to make any desired changes in the parameters.  Alternatively, use the menu File/Open to recall parameters saved earlier in a file.  Note: use a low number of stars (2-40) until you become familiar with the operation of the program.  This will make things happen faster.

Select the Init menu to initialize the display.  The stars are stationary.  You may use Init at any time to initialize a new simulation with a new star field.

Select the Run menu to start the simulation.  The stars move.  You may start and stop the simulation by selecting Run repeatedly.

Select Cancel to terminate at any time (it may need a few seconds to die).

While running, you may go back and select any other menu.  New parameters will be effective with the next Run command, except that the number of stars will not change until Init is selected again.

If you wish to save the current parameter settings for later recall, use the menu File/Save As for this.


Setting Parameters

When the menu Setup is selected, you get a dialog box as follows:

Use the mouse or tab key to select any desired parameter.  You may edit the new value directly inside its box, or use the scroll bar to adjust the value up or down.  The number of stars may range from 2 to 1000 stars.  The other parameters range from 0 to 99.  See the topic Parameter Names for an explanation of each parameter.


Saving and Recalling Parameters

When the menu  File/Open  or  File/Save As  is selected, you get the following dialog:

This dialog is used to specify a file and directory name for loading parameters from disk (File/Open), or saving parameters to disk (File/Save As).  It is like most other file dialogs in Microsoft Windows.

Use the mouse to select a file from the select list, or select another directory, or select another drive (the select list will be updated).  You may also type a file or directory name directly into the edit controls.  You may type a wildcard file name into the filter control, and this will cause only matching files to appear in the select list.  Use the filter button to refresh the select list after editing the filter or directory name.  When you have gotten the desired file name and directory name to appear, choose OK to complete the command.  Choose cancel to  return to the main menu without any action being taken.


Menu Items

The Menu for Galaxy is summarized below:

File	container for three following menu items
   Open	open a file and read parameters from this file
   Save	save current parameters in the same file they came from
   Save As	save current parameters in a specified file name
   Exit	quit program, close window
Setup	view parameters and make any desired changes
Init	generate and display a new distribution of stars
Run	toggle: start or stop simulation (star motion)
Cancel	quit program, close window
Help	view help topics (this file)


Parameter Table

Parameter Name	Description

Number of Stars	number of stars to display and simulate
(2 to 1000)

Gravitational Constant 	relative strength of attractive force between
(0 to 99)	each pair of stars

Initial Velocity	velocity of stars at start of simulation
(0 to 99)	(clockwise motion around center of window)

Damping Factor	star velocities are periodically multiplied by this
(0 to 99)	number, which causes the stars to collapse more
rapidly into a tighter distribution

    Input Value	    Damping Factor
  0	1.0  (no damping)
10	0.9999
32	0.999
99	0.99

Calculation Precision	a high value produces a more accurate simulation,
(0 to 99)	but the execution is considerably slower.


Application Notes

The execution time is proportional to the square of the number of stars, so a large number of stars results in slow execution.  The computer needs to make about twenty arithmetic calculations to compute the attractive force between two stars.  For 1000 stars, this is 20 million calculations.  These calculations are repeated continuously as the stars move and the forces change.  A star's new acceleration is computed from the net attractive force from all other stars, and then its new velocity is computed, and then its new position.  If you want to watch 1000 stars, you need to wait a few minutes (or hours, depending on the speed of your computer) to see how the pattern evolves.

The execution can be speeded up by using a low value for the Calculation Precision parameter.  This reduces the frequency of recalculation of forces and accelerations (i.e. the stars are moved for longer time intervals between recalculations of acceleration).  The net effect is that energy is added to the system (i.e. average velocities tend to get larger), and the distribution of stars expands.  You may compensate for this by using a larger value for the Damping Factor parameter, which causes energy to be lost from the system.


Usage as Screen Saver

Use of Galaxy as a Screen Saver

You may use Galaxy as a Windows Screen Saver as follows:

1)  Copy the execution file galaxy.exe into your windows directory.

     (default is  c:\windows)

2)  Rename the file to galaxy.scr  (c:\windows\galaxy.scr).

3)  Activate Program Manager, select Control Panel, select Desktop.

     Select Galaxy Simulation as your screen saver function.

4)  Press the setup button and the Galaxy program should now run.

5)  Select the setup menu and enter setup parameters as desired.

6)  Use the File/Save As menu to save the setups in the file galaxy.ini
     in the windows directory (full name c:\windows\galaxy.ini).  The setup
     data saved here will be used whenever the screen saver is activated.

7)  Exit the Galaxy program, returning to the Control Panel dialog.  Press the
     test button to test that the screen saver runs.  It should cover the whole
     screen, and show no menu bar.  Press any key, or the left mouse button,
     to return back to Control Panel.  This completes the setup.

You may change the screen saver parameters saved in galaxy.ini at any time by repeating steps 3 to 6 above.